<?php

$data = array();
$sec_id = $_GET['sec_id'];

$result = $dbfunc->query("SELECT * FROM tb_sec NATURAL JOIN tb_teacher NATURAL JOIN tb_subject WHERE sec_id='{$sec_id}'");
$data['sec'] = mysql_fetch_assoc($result);

$sql = "select * from tb_job NATURAL JOIN tb_sec NATURAL JOIN tb_teacher WHERE sec_id='{$sec_id}'";
$result = $dbfunc->query($sql);

$data['job'] = array();
while($item = mysql_fetch_assoc($result)){
    $data['job'][] = $item;
}

echo json_encode($data);